import java.util.HashMap;

/**
 * @author tongchen
 * @create 2023-02-01 20:48
 */
public class FindOnlyNum1 {
    public static void main(String[] args) {
        //思路十分简单，利用hashMap直接对对每个数字的次数进行计算即可
        HashMap<Integer, Integer> map = new HashMap<>();
        //定义数组和次数
        int[]nums={1,1,1,2,2,2,3,3,3,4};
        int frequency=3;
        for (int i = 0; i < nums.length; i++) {
         int x=  map.get(nums[i])!=null? map.get(nums[i])+1:1;
            map.put(nums[i],(x));
        }
        //遍历map取值
        for (int i = 0; i < nums.length ; i++) {
           if( map.get(nums[i])!=3){
                System.out.println(nums[i]);
                return;
            }
        }
    }
}
